package com.jt;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 金帮嘉诚 @date 2021-08-23 星期一 10:41
 */
@Component
public class DefaultRequestOriginParser
implements RequestOriginParser {
    /**
     * url:http://localhost:8090/consumer/authority
     * */
    @Override
    public String parseOrigin(HttpServletRequest request) {
        return request.getParameter("origin");//自己定义参数名
    }
}
